<?php
$catid = (int) $_GET['catid'];
$id = (int) $_GET['id'];
$p_url = go($catid,$id);
?>
{template "member","header"}

<!-- header -->
<header class="header bg2 clearfix" {$catid}>
	<h3 class="fl"><a href="{get_ref($p_url)}" title="返回上一级"><img src="{IMG_PATH2}icon/back.png" alt="返回上一级"></a></h3>
	<span class="con">我要约见</span>
</header>
<!-- / header -->
<div class="h_48"></div>

<!-- main -->
<main class="main">
	<form id="myformyuejian">	
		<!-- <div class="liucheng padding1 bgwhite">
			<ul class="liucheng_icon clearfix">
				<li class="on"><span><em></em></span></li>
				<li><span><em></em></span></li>
				<li><span><em></em></span></li>
				<li><span><em></em></span></li>
			</ul>
			<ul class="liucheng_txt clearfix">
				<li class="on">提交申请</li>
				<li>专家确认</li>
				<li>用户付款</li>
				<li>交易完成</li>
			</ul>
		</div> -->
		<div class="h_10"></div>
		<div class="bgwhite padding1 message_input">
			<div class="message_input1 clearfix ">
				<label>姓名<em> * </em> </label>
				<input type="text" class="input2" id="username">
			</div>
			<div class="message_input1 clearfix ">
				<label>手机<em> * </em> </label>
				<input type="text" class="input2" id="mobile">
			</div>
		</div>
		<div class="h_5"></div>
		<div class="my_ziliao">可接受的预约方式 <em>*</em></div>
		<script src="{JS_PATH2}tab.js"></script>
		<script type="text/javascript">
		$(function() {
			$(".content").all_tab({
				effect: "fade",
				trigger: "click",
				delayTime: 10
			});
		});
		</script>

		<div class="content">
			<ul class="yuyueway tab bgwhite clearfix">
				<a href="javascript:;">电话约谈</a>
				<a href="javascript:;">导师约见</a>
				<a href="javascript:;">任务委托</a>
			</ul>
			<div class="h_5"></div>
			<div class="detail_yuejian bgwhite padding1">
				<div class="h_20 bgwhite"></div>
				 <textarea rows=3 class="textarea1"  maxlength="300"  onkeyup="javascript:checkWord(this);" onmousedown="javascript:checkWord(this);"  
            name="content" style="overflow-y: auto" id="con" onfocus="if(value=='描述一下您的需求背景'){value=''}"
			    onblur="if (value ==''){value='描述一下您的需求背景'}">描述一下您的需求背景</textarea>  
				<div class="detail_yuejian_num"><strong id="wordCheck">0</strong>/300</div>
			</div>
			 <style>
	        textarea#con{
	        	display: block;
			    padding: 10px;
			    color: #cccccc;
			    font-size: 16px;
			    width: 100%;
			    border: none;
			    -webkit-box-shadow: none;
			    -moz-box-shadow: none;
			    -o-box-shadow: none;
			    box-shadow: none;
			    float: none;
			    -webkit-border-radius: 3px;
			    -moz-border-radius: 3px;
			    border-radius: 3px;
			    font-family: "Microsoft Yahei";
	        }

	        </style>
			<div class="h_5"></div>
			<div class="tab_con">
			<div class="my_ziliao">希望约谈过程中能解决的问题 </div>
			<div class="bgwhite padding1 message_input">
				<div class="message_input1 clearfix ">
					<label>问题1</label>
					<input type="text" class="input2" id="title1" maxlength="20" onkeyup="javascript:checkWord1(this);" onmousedown="javascript:checkWord1(this);"  
            name="content">
					<em><strong  id="wordCheck1">0</strong>/20</em>
				</div>
				<div class="message_input1 clearfix">
					<label>问题2</label>
					<input type="text" class="input2" id="title2" maxlength="20" onkeyup="javascript:checkWord1(this);" onmousedown="javascript:checkWord1(this);"  
            name="content">
					<em><strong id="wordCheck2">0</strong>/20</em>
				</div>
			</div>
			<div class="h_5"></div>
			<div class="my_ziliao">希望约谈时间安排在 <em>*</em></div>
			<div class="clearfix bgwhite radio_select">
				<div><input type="radio" name="date0" id="date1" value="0" checked="checked"><label for="date1">3天内</label></div>
				<div><input type="radio" name="date0" id="date2" value="1"><label for="date2">5天内</label></div>
				<div><input type="radio" name="date0" id="date3" value="2"><label for="date3">一周内</label></div>
				<div><input type="radio" name="date0" id="date4" value="3"><label for="date4">不限</label></div>
			</div>
			<div class="h_5"></div>
			<div class="date_select padding1 bgwhite">
				<div class="t1">选择约谈时长</div>
				<select id="sel_0">
					<option value="0">30分钟</option>
					<option value="1">1小时</option>
					<option value="2">1小时30分钟</option>
					<option value="3">2小时</option>
					<option value="4">2小时30分钟</option>
					<option value="5">3小时</option>
					<option value="6">3小时30分钟</option>
					<option value="7">4小时</option>
				</select>
			</div>
			</div>

			<div class="tab_con">
			<div class="my_ziliao">希望约见过程中能解决的问题</div>
			<div class="bgwhite padding1 message_input">
				<div class="message_input1 clearfix ">
					<label>问题1</label>
					<input type="text" class="input2" id="title1" maxlength="20" onkeyup="javascript:checkWord1(this);" onmousedown="javascript:checkWord1(this);"  
            name="content">
					<em><strong  id="wordCheck1">0</strong>/20</em>
				</div>
				<div class="message_input1 clearfix">
					<label>问题2</label>
					<input type="text" class="input2" id="title2" maxlength="20" onkeyup="javascript:checkWord1(this);" onmousedown="javascript:checkWord1(this);"  
            name="content">
					<em><strong id="wordCheck2">0</strong>/20</em>
				</div>
			</div>
			<div class="h_5"></div>
			<div class="my_ziliao">希望约见时间安排在 <em>*</em></div>
			<div class="clearfix bgwhite radio_select">
				<div><input type="radio" name="date1" id="date1" value="0" checked="checked"><label for="date1">3天内</label></div>
				<div><input type="radio" name="date1" id="date2" value="1"><label for="date2">5天内</label></div>
				<div><input type="radio" name="date1" id="date3" value="2"><label for="date3">一周内</label></div>
				<div><input type="radio" name="date1" id="date4" value="3"><label for="date4">不限</label></div>
			</div>
			<div class="h_5"></div>
			<div class="date_select padding1 bgwhite">
				<div class="t1">选择约见时长</div>
				<select id="sel_1">
					<option value="0">1小时</option>
					<option value="1">2小时</option>
					<option value="2">3小时</option>
					<option value="3">4小时</option>
					<option value="4">5小时</option>
					<option value="5">6小时</option>
					<option value="6">7小时</option>
					<option value="7">8小时</option>
					<option value="8">更多</option>
				</select>

			</div>
			</div>


			<div class="tab_con">
			<div class="my_ziliao">希望任务委托过程中能解决的问题</div>
			<div class="bgwhite padding1 message_input">
				<div class="message_input1 clearfix ">
					<label>问题1</label>
					<input type="text" class="input2" id="title1" maxlength="20" onkeyup="javascript:checkWord1(this);" onmousedown="javascript:checkWord1(this);"  
            name="content">
					<em><strong  id="wordCheck1">0</strong>/20</em>
				</div>
				<div class="message_input1 clearfix">
					<label>问题2</label>
					<input type="text" class="input2" id="title2" maxlength="20" onkeyup="javascript:checkWord1(this);" onmousedown="javascript:checkWord1(this);"  
            name="content">
					<em><strong id="wordCheck2">0</strong>/20</em>
				</div>
			</div>
			<div class="h_5"></div>
			<div class="my_ziliao">希望任务委托时间安排在 <em>*</em></div>
			<div class="clearfix bgwhite radio_select">
				<div><input type="radio" name="date2" id="date1" value="0" checked="checked"><label for="date1">3天内</label></div>
				<div><input type="radio" name="date2" id="date2" value="1"><label for="date2">5天内</label></div>
				<div><input type="radio" name="date2" id="date3" value="2"><label for="date3">一周内</label></div>
				<div><input type="radio" name="date2" id="date4" value="3"><label for="date4">不限</label></div>
			</div>
			<div class="h_5"></div>
			<div class="date_select padding1 bgwhite">
				<div class="t1">选择委托事件数量</div>
				<select id="sel_2">
					<option value="0">1件</option>
					<option value="1">2件</option>
					<option value="2">3件</option>
					<option value="3">4件</option>
					<option value="4">5件</option>
					<option value="5">更多</option>
				</select>
			</div>
			</div>

		</div>

		<div class="h_75"></div>
		<div class="btn_dui"><a href="javascript:void(0);" class="js_duihuan" data-reveal-id="myModal1" data-animation="fade">提 交</a></div>

	</form>
	<script type="text/javascript">
	$('.js_duihuan').click(function(){
		var username=$('#username').val();
		var mobile=$('#mobile').val();
		var type=$('.yuyueway .cur').parent().index();
		var con=$('#con').val();
		var title1=$('#title1').val();
		var title2=$('#title2').val();
		var id={$id};
		var date=$('input:radio[name="date'+type+'"]:checked').val();
		var num=$('#sel_'+type).find("option:selected").val();
		$.post('?m=member&c=apply&a=add_yuyue',{a_id:id,realname:username,mobile:mobile,type:type,con:con,title1:title1,title2:title2,date:date,num:num},function(data){	
				alert_msg(data,function() {
					//location.hash = 'commit';
					//location.reload();
					if (data=='预约申请已成功') {
						window.location.href='show-2-'+id+'-1.html';
					};
				},3000);
				
			})
	})
	$("#con").keyup(function(){
         var length = 300;
         var content_len = $("#con").val().length;
         var in_len = length-content_len;
        
         if(in_len >0){
            $("#wordCheck").html(content_len);
            $("#con").attr("disabled",false);            
         }else{
            $("#wordCheck").html(content_len);
            $("#con").attr("disabled",true);
            return false;
         }        
    });
    $("#title1").keyup(function(){
         var length = 20;
         var content_len = $("#title1").val().length;
         var in_len = length-content_len;
        
         if(in_len >0){
            $("#wordCheck1").html(content_len);
            $("#title1").attr("disabled",false);            
         }else{
            $("#wordCheck1").html(content_len);
            $("#title1").attr("disabled",true);
            return false;
         }        
    });
    $("#title2").keyup(function(){
         var length = 20;
         var content_len = $("#title2").val().length;
         var in_len = length-content_len;
        
         if(in_len >0){
            $("#wordCheck2").html(content_len);
            $("#title2").attr("disabled",false);            
         }else{
            $("#wordCheck2").html(content_len);
            $("#title2").attr("disabled",true);
            return false;
         }        
    });
	</script>
</main>
<!-- / main -->
<!--<script type="text/javascript">

    var maxstrlen = 300;
    var maxstrlen1 = 20;  
        function Q(s) { return document.getElementById(s); }     
        function checkWord(c) {  
            len = maxstrlen;  
            var str = c.value;  
            myLen = getStrleng(str);  
            var wck = Q("wordCheck");  
   
            if (myLen > len) {  
                alert("最多不能超过300个字！");
            }  
            else {  
                wck.innerHTML = Math.floor( myLen);  
            }  
        }  
   
        function getStrleng(str) {  
            myLen = 0;  
            i = 0;  
            for (; (i < str.length) && (myLen <= maxstrlen ); i++) {  
                if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 300)  
                    myLen++;  
                else  
                    myLen += 2;  
            }  
            return myLen;  
        }  

</script>
-->
<style>
textarea::-webkit-scrollbar {
    width: 2px;
    height: 2px;}

</style>
{template "content","footer"}